def yunzai_installer(func):
    def wrapper(self, *args, **kwargs):
        result = func(self, *args, **kwargs)
        if not result:
            return None

        window, process, target_dir, version, name = result

        def handle_stdout():
            text = process.readAllStandardOutput().data().decode('utf-8', 'ignore')
            window.view_model.log_updated.emit(f"[安装] {text.strip()}")


        def handle_stderr():
            text = process.readAllStandardError().data().decode('utf-8', 'ignore')
            window.view_model.log_updated.emit(f"[安装错误] {text.strip()}")

        process.finished.connect(lambda: self._post_install(window, process, target_dir, version, name))
        return result

    return wrapper